import * as user from '@/api/user.js'
	export default {
		name: "contacts",
		data() {
			return {
				title: '',
				text:'',
				phone: ''
			};
		},
		onLoad() {
		},
		onShow() {
		},
		methods: {
			saveBnt() {
				if(!this.phone) {
					this.$tools.toast('请输入手机号');
					return
				}
				if(!this.title) {
					this.$tools.toast('请输入标题');
					return
				}
				if(!this.text) {
					this.$tools.toast('请输入反馈内容');
					return
				}
				uni.showModal({
				    title: '提示',
				    content: '确定提交反馈吗?',
				    success:(res)=> {
						if (res.confirm) {
							var data = {
								title: this.title,
								phone: this.phone,
								text: this.text
							}
							user.feedback(data).then(res=>{
								this.$tools.toast('提交成功');
								setTimeout(res=>{
									uni.navigateBack({
										data:1
									})
								},1000)
							})
						}
				    }
				})
			}
		}
	}